Skip to main content

Mouse Click

AutomatR.Web.MouseClick

The "Mouse Click" activity in AutomatR's Web Activities category is designed to simulate a mouse click on a specified UI element based on either its position coordinates or a provided web selector. This activity is useful for interacting with web elements in a browser automation workflow.

Properties

NameDescription
Input
Coordinate XSpecifies the X-coordinate value based on the element's position on the web page. Provide an integer value representing the horizontal position.
Coordinate YSpecifies the Y-coordinate value based on the element's position on the web page. Provide an integer value representing the vertical position.
ElementAllows you to select the web element using the selector window. Use this property if you want to indicate the web element directly within the activity.
WebElementSpecifies the UI Element variable identified by the "Find Element" or other activities. This allows you to use a previously identified web element in the workflow.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Mouse Click" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
Delay Before ClickSpecifies the wait time (in seconds) before the activity performs any operations, such as moving the mouse and clicking. This can be useful for adjusting to dynamic page elements. Integer variables containing the delay duration.
TimeoutSpecifies the maximum time (in seconds) to wait for the activity to be executed before throwing an exception. Integer variables containing the timeout duration. The default timeout is set in the Constants.Timeout constant.
Match TextEnter the string of text description matching the element when the Element is selected. This can be useful for identifying the element when using a web selector.
Output
ResultOutputs a boolean value indicating whether the mouse click action was successful or encountered any errors. Variables of relevant types (e.g., Boolean variables) can be used to store the operation result.

How to use:

  1. Drag and drop the "Mouse Click" activity onto the workflow.
  2. Configure the properties based on your requirements:
    • Provide the web element directly using the "Element" property or use a UI Element variable with "WebElement."
    • Specify the position coordinates (X and Y) if you don't want to use a web selector.
    • Adjust optional properties such as delay and timeout.
  3. Execute the workflow to simulate a mouse click on the specified web element or coordinates.

Example: Consider an example where the "Mouse Click" activity is used to click a button on a web page:

Mouse Click:
Delay: 2
Coordinate X: 300
Coordinate Y: 200
Result: isClickSuccessful

In this example, the activity waits for 2 seconds, moves the mouse to the position (300, 200) on the web page, and performs a click. The result of the operation (success or failure) is stored in the Boolean variable "isClickSuccessful" for further handling in the workflow.